#!/bin/sh

IFS=";"

cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<testdefinition version="1.0">
    <suite name="telepathy-qt@QT_VERSION_MAJOR@">
        <description>Telepathy Qt @QT_VERSION_MAJOR@ tests</description>
        <set name="telepathy-qt@QT_VERSION_MAJOR@-unit-tests">
EOF

for testcase in $(cat tests/unit-tests.list)
do
    #testcase_name=$(echo $testcase|sed 's/\//_/')
    attributes="name=\"$testcase\""
    insignificant=`grep "^$testcase" tests/INSIGNIFICANT || true`
    if test -n "$insignificant"
    then
        continue
        attributes="$attributes insignificant=\"true\""
    fi
    cat <<EOF
        <case $attributes>
            <step>@NEMO_TESTS_DIR_BIN@/runTest.sh @NEMO_TESTS_DIR_BIN@/$testcase</step>
        </case>
EOF
done

cat <<EOF
        </set>
        <set name="telepathy-qt@QT_VERSION_MAJOR@-dbus-tests">
EOF

for testcase in $(cat tests/dbus/dbus-tests.list)
do
    #testcase_name=$(echo $testcase|sed 's/\//_/')
    attributes="name=\"$testcase\""
    insignificant=`grep "^$testcase" tests/INSIGNIFICANT || true`
    if test -n "$insignificant"
    then
        continue
        attributes="$attributes insignificant=\"true\""
    fi
    cat <<EOF
        <case $attributes>
            <step>@NEMO_TESTS_DIR_BIN@/runDbusTest.sh @NEMO_TESTS_DIR_BIN@/$testcase</step>
        </case>
EOF
done

cat <<EOF
        </set>
    </suite>
</testdefinition>
EOF

